package webServiceClient.academico;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

public class WebServiceClient {
	// private static final String IP = "http://169.254.156.236:8080/";
	// private static final String IP = "http://10.1.15.94:8080/";
	private static final String IP = "http://192.168.42.113:8080/"; // CELULAR

	private static final String SOAP_ACTION = IP
			+ "axis2/services/GestorAcademico";
	private static final String NAMESPACE = "http://servidor";
	private static final String URL = IP
			+ "axis2/services/GestorAcademico?wsdl";
	private static final String SOAP_ACTION_ATIVIDADE = IP
			+ "axis2/services/GestorAtividade";
	private static final String URL_ATIVIDADE = IP
			+ "axis2/services/GestorAtividade?wsdl";

	public String[] getAlunos(String METHOD_NAME, long raMaster,
			String senhaMaster) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raPessoa", raMaster);
		request.addProperty("senhaPessoa", senhaMaster);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String[] getProfessores(String METHOD_NAME, long raMaster,
			String senhaMaster) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raPessoa", raMaster);
		request.addProperty("senhaPessoa", senhaMaster);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String[] getTurmas(String METHOD_NAME, long raMaster,
			String senhaMaster, int anoTurma) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raPessoa", raMaster);
		request.addProperty("senhaPessoa", senhaMaster);
		request.addProperty("anoTurma", anoTurma);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String[] getDisciplinas(String METHOD_NAME, long raMaster,
			String senhaMaster) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raPessoa", raMaster);
		request.addProperty("senhaPessoa", senhaMaster);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String[] getPontuacao(String METHOD_NAME, long raMaster,
			String senhaMaster, long raAluno, String codDisciplina,
			String codTurma, int anoTurma, String codAtividade) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raPessoa", raMaster);
		request.addProperty("senhaPessoa", senhaMaster);
		request.addProperty("raAluno", raAluno);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("codTurma", codTurma);
		request.addProperty("anoTurma", anoTurma);
		request.addProperty("codAtividade", codAtividade);

		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(
					URL_ATIVIDADE);
			androidHttpTransport.call(SOAP_ACTION_ATIVIDADE, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String[] getAtividade(String METHOD_NAME, long raMaster,
			String senhaMaster, String codDisciplina) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("codDisciplina", codDisciplina);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(
					URL_ATIVIDADE);
			androidHttpTransport.call(SOAP_ACTION_ATIVIDADE, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String setAlunoTurma(String METHOD_NAME, long raMaster,
			String senhaMaster, long raAluno, String codTurma, int anoTurma) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("raAluno", raAluno);
		request.addProperty("codTurma", codTurma);
		request.addProperty("anoTurma", anoTurma);	
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}
	
	public String setProTur(String METHOD_NAME, long raMaster,
			String senhaMaster, long raProfessor, String codTurma, int anoTurma) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("raProfessor", raProfessor);
		request.addProperty("codTurma", codTurma);
		request.addProperty("anoTurma", anoTurma);	
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String setDisPro(String METHOD_NAME, long raMaster,
			String senhaMaster, String codDisciplina, long raProfessor) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("raProfessor", raProfessor);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String setDisTur(String METHOD_NAME, long raMaster,
			String senhaMaster, String codDisciplina, String codTurma,
			int anoTurma) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("codTurma", codTurma);
		request.addProperty("anoTurma", anoTurma);

		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String setOffAtividade(String METHOD_NAME, long raMaster,
			String senhaMaster, String codAtividade, String codDisciplina,
			String codTurma, int anoTurma, String dataEnd, int isDisponivel) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raProfessor", raMaster);
		request.addProperty("senhaProfessor", senhaMaster);
		request.addProperty("codAtividade", codAtividade);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("codTurma", codTurma);
		request.addProperty("anoTurma", anoTurma);
		request.addProperty("isDisponivel", isDisponivel);
		request.addProperty("dataFim", dataEnd);

		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(
					URL_ATIVIDADE);
			androidHttpTransport.call(SOAP_ACTION_ATIVIDADE, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String setOnAtividade(String METHOD_NAME, long raMaster,
			String senhaMaster, String codAtividade, String codDisciplina,
			String codTurma, int anoTurma, String dataStart, String dataEnd,
			int isDisponivel, String valorAtv) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raProfessor", raMaster);
		request.addProperty("senhaProfessor", senhaMaster);
		request.addProperty("codAtividade", codAtividade);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("codTurma", codTurma);
		request.addProperty("anoTurma", anoTurma);
		request.addProperty("dataLiberacao", dataStart);
		request.addProperty("dataFechamento", dataEnd);
		request.addProperty("isDisponivel", isDisponivel);
		request.addProperty("valorAtividade", valorAtv);

		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(
					URL_ATIVIDADE);
			androidHttpTransport.call(SOAP_ACTION_ATIVIDADE, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String addAtividade(String METHOD_NAME, long raMaster,
			String senhaMaster, String codAtividade, String nomAtividade,
			String codDisciplina, int isDisponivel) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raProfessor", raMaster);
		request.addProperty("senhaProfessor", senhaMaster);
		request.addProperty("codAtividade", codAtividade);
		request.addProperty("nome", nomAtividade);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("isDisponivel", isDisponivel);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(
					URL_ATIVIDADE);
			androidHttpTransport.call(SOAP_ACTION_ATIVIDADE, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String addTurma(String METHOD_NAME, long raMaster,
			String senhaMaster, String codTurma, String nomTurma, int anoTurma,
			String codCurso) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("codTurma", codTurma);
		request.addProperty("nomTurma", nomTurma);
		request.addProperty("anoTurma", anoTurma);
		request.addProperty("codCurso", codCurso);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String[] getAtividadeDisponivel(String METHOD_NAME, long raMaster,
			String senhaMaster, String codDisciplina, String codTurma,
			int anoTurma) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raPessoa", raMaster);
		request.addProperty("senhaPessoa", senhaMaster);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("codTurma", codTurma);
		request.addProperty("anoTurma", anoTurma);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(
					URL_ATIVIDADE);
			androidHttpTransport.call(SOAP_ACTION_ATIVIDADE, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			System.out.println(e);
			return null;
		}
	}

	public String[] getTurmasProfessorAno(String METHOD_NAME, long raMaster,
			String senhaMaster, long raProfessor, int anoTurma) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("raProfessor", raProfessor);
		request.addProperty("anoTurma", anoTurma);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String[] getDisciplinaProfessor(String METHOD_NAME, long raMaster,
			String senhaMaster, long raProfessor) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("raProfessor", raProfessor);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String[] getCursos(String METHOD_NAME, long raMaster,
			String senhaMaster, int isDisponivel) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("isDisponivel", isDisponivel);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			KvmSerializable response = null;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			response = (KvmSerializable) envelope.bodyIn;
			if (response != null) {
				SoapPrimitive[] s = new SoapPrimitive[response
						.getPropertyCount()];
				String[] ss = new String[response.getPropertyCount()];
				for (int i = 0; i < response.getPropertyCount(); i++) {
					s[i] = (SoapPrimitive) response.getProperty(i);
					ss[i] = s[i].toString();
				}
				return ss;
			}
			return null;
		} catch (Exception e) {
			return null;
		}
	}

	public String addDisciplina(String METHOD_NAME, long raMaster,
			String senhaMaster, String codDisciplina, String nomDisciplina) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("codDisciplina", codDisciplina);
		request.addProperty("nome", nomDisciplina);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String addCurso(String METHOD_NAME, long raMaster,
			String senhaMaster, String codCurso, String nomCurso,
			int isDisponivel) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("codCurso", codCurso);
		request.addProperty("nomCurso", nomCurso);
		request.addProperty("isDisponivel", isDisponivel);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getLocalizedMessage();
		}
	}

	public String logoffProfessor(String METHOD_NAME, long ra, String senha) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raProfessor", ra);
		request.addProperty("senhaProfessor", senha);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getLocalizedMessage();
		}
	}

	public String loginProfessor(String METHOD_NAME, long ra, String senha) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raProfessor", ra);
		request.addProperty("senhaProfessor", senha);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.dotNet = false;
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getMessage();
		}
	}

	public String addProfessor(String METHOD_NAME, long raMaster,
			String senhaMaster, long raProfessor, String nomProfessor,
			String data, String email, String senha, String sexo) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("raProfessor", raProfessor);
		request.addProperty("nomProfessor", nomProfessor);
		request.addProperty("datNascimento", data);
		request.addProperty("email", email);
		request.addProperty("senha", senha);
		request.addProperty("sexo", sexo);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getLocalizedMessage();
		}
	}

	public String addAluno(String METHOD_NAME, long raMaster,
			String senhaMaster, long raAluno, String nomAluno, String data,
			String email, String senha, String sexo) {
		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
		request.addProperty("raMaster", raMaster);
		request.addProperty("senhaMaster", senhaMaster);
		request.addProperty("raAluno", raAluno);
		request.addProperty("nomAluno", nomAluno);
		request.addProperty("datNascimento", data);
		request.addProperty("email", email);
		request.addProperty("senha", senha);
		request.addProperty("sexo", sexo);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		try {
			envelope.setOutputSoapObject(request);
			HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
			androidHttpTransport.call(SOAP_ACTION, envelope);
			SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();
			return sp.toString();
		} catch (Exception e) {
			return e.getLocalizedMessage();
		}
	}
}
